package day1104.demo03;

import java.util.stream.Stream;

/**
 * @program: qy158
 * @description:
 * @author: 闫克起2
 * @create: 2022-11-05 09:35
 **/
public class Test04 {
    public static void main(String[] args) {
        String[] arr1 = { "a", "b", "c", "d" };
        String[] arr2 = { "d", "e", "f", "g" };
        Stream<String> stream1 = Stream.of(arr1);
        Stream<String> stream2 = Stream.of(arr2);

        //合并流
        //Stream.concat(stream1,stream2).forEach(System.out::println);
        //去重--distinct
       // Stream.concat(stream1,stream2).distinct().forEach(System.out::println);

        //获取前n个元素--limit
        //Stream.concat(stream1,stream2).limit(5).forEach(System.out::println);

        //跳过前n个元素
        Stream.concat(stream1,stream2).skip(2).forEach(System.out::println);
    }
}
